<?php
namespace console\services;


class MigrateService {

    /**
     * 创建迁移表时的额外信息
     * @param string $comment
     * @return string|null
     */
    public static function createTableOptions($comment = ''): ?string
    {
        if (\Yii::$app->db->driverName == 'mysql') {
            $options = "ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic";
            if ($comment) $options = $options." COMMENT = '".$comment."' ";
            return $options;
        }

        return null;
    }
}
